<?php 

	class Shop_goods_listModel extends Model{

		public $table = 'shop_goods_list';

		public function get_son($cid){
			$data = K('Shop_category')->all();
			$cids = $this->get_son_id($data,$cid);
			$cids[]=$cid;
			return $cids;
		}

		public function get_son_id($data,$cid){
			$temp = array();
			
			foreach ($data as $v) {
				if ($v['pid'] == $cid) {
					$temp[]= $v['cid'];
					$temp = array_merge($temp,$this->get_son_id($data,$v['cid']));
				}
			}

			return $temp;
		}

		
	}










 ?>